drop table customers;

create table customers(
id number primary key,
cname varchar2(20),sal number(5,2),sex char(1),birth date,isdelete char(1));

create table favorites(id number primary key,fav varchar2(20) not null unique);

create table customer_fav(c_id number,f_id number,
constraint FK_CID_CFID foreign key(c_id) references customers(id),
constraint FK_FID_CFID foreign key(f_id) references favorites(id),
constraint PK_CID_FID primary key(c_id,f_id)
)

create sequence cseq start with 1 increment by 1;
create sequence fseq start with 1 increment by 1;

insert into favorites values(fseq.nextval,'篮球');
insert into favorites values(fseq.nextval,'足球');
insert into favorites values(fseq.nextval,'羽毛球');

select * from FAVORITES;

select * from CUSTOMERS;

select * from CUSTOMER_FAV;